Ext.define('DragonApp.view.login.Form', {
    extend: 'Ext.form.Panel',
    xtype: 'loginform',

    layout: {
        type: 'anchor'
    },
    defaults: {
        xtype: 'textfield',
        vtype: 'alphanum',
        anchor: '100%',
        labelWidth: 70,
        labelAlign: 'left',
        allowBlank: false,
        enableKeyEvents: true,
        listeners: {
            specialKey: 'onTextFieldSpecialKey'
        }
    },
    items: [{
        name: 'user',
        fieldLabel: '用户名',
        maxLength: 15,
        emptyText: 'user'

    }, {
        name: 'pass',
        id: 'password',
        inputType: 'password',
        fieldLabel: '密码',
        maxLength: 15,
        emptyText: 'pass',
        listeners: {
            keypress: 'onTextFieldKeyPress'
        }
        //vtype: 'customPass',
    }, {
        xtype: 'checkbox',
        fieldLabel: '记住我',
        name: 'Remember',
        submitValue: false,
        inputValue: "true",
        uncheckedValue: "false",
        itemId: "remember_me"
    }],

    buttons: [{
        text: '取消',
        iconCls: 'fa fa-times fa-lg',
        formBind: false,
        listeners: {
            click: 'onCancelClick'
        }
    }, {
        text: '登录',
        id: 'loginBtn',
        iconCls: 'fa fa-sign-in fa-lg',
        formBind: true,
        listeners: {
            click: 'onSubmitClick'
        }
    }],

    listeners: {
        beforerender: {
            fn: 'setCookieField'
        }
    }
});